package com.cloudpolice.equipment.service.Impl;

import com.cloudpolice.equipment.dao.EquipmentMessageMapper;
import com.cloudpolice.equipment.model.EquipmentMessageModel;
import com.cloudpolice.equipment.model.InPutParam.EquipmentMessageSelectInParam;
import com.cloudpolice.equipment.service.EquipmentMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：梁昊，后端工程师：flyman5，前端工程师：孙耀
 * @create 2020-04-01 22:33
 * @function
 * @editLog
 */
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
@Service
public class EquipmentMessageServiceImpl implements EquipmentMessageService {
    @Autowired
    EquipmentMessageMapper equipmentMessageMapper;
    /**
     * 根据社区ID或区域ID得到消息与通知信息
     *
     * @param id
     * @return 设备基本信息
     */
    @Override
    public EquipmentMessageModel selectEquipmentMessageById(String id) {
        return equipmentMessageMapper.selectEquipmentMessageById(id);
    }

    /**
     * 根据社区ID或区域ID得到消息与通知信息
     *
     * @param equipmentMessageSelectInParam 根据社区ID或区域ID得到消息与通知信息
     * @return 设备基本信息
     */
    @Override
    public List<EquipmentMessageModel> selectEquipmentMessageByCom(EquipmentMessageSelectInParam equipmentMessageSelectInParam) {
        return equipmentMessageMapper.selectEquipmentMessageByCom(equipmentMessageSelectInParam);
    }



    /**
     * 修改门禁机消息与通知
     *
     * @param equipmentMessageModel com.cloudpolice.equipment.model.EquipmentMessageModel
     * @return 影响条件
     */
    @Override
    public int updateEquipmentMessage (EquipmentMessageModel equipmentMessageModel) {
        return equipmentMessageMapper.updateEquipmentMessage(equipmentMessageModel);
    }

    @Override
    public int deleteEquipmentMessageAuto(EquipmentMessageModel equipmentMessageModel) {
        return equipmentMessageMapper.deleteEquipmentMessageAuto(equipmentMessageModel);
    }

    /**
     * 删除门禁机消息与通知
     *
     * @param equipmentMessageModel com.cloudpolice.equipment.model.InPutParam.EquipmentMessageModel
     * @return 影响条件
     */
    @Override
    public int deleteEquipmentMessage (EquipmentMessageModel equipmentMessageModel) {
        return equipmentMessageMapper.deleteEquipmentMessage(equipmentMessageModel);
    }

    /**
     * 增加门禁机消息与通知
     *
     * @param equipmentMessageModel com.cloudpolice.equipment.model.InPutParam.EquipmentMessageModel
     * @return 影响条件
     */
    @Override
    public int insertEquipmentMessage (EquipmentMessageModel equipmentMessageModel) {
        return equipmentMessageMapper.insertEquipmentMessage(equipmentMessageModel);
    }

    /**
     * 根据设备SN号得到消息与通知信息
     *
     * @param equipmentMessageSelectInParam 根据设备SN号得到消息与通知信息
     * @return 设备基本信息
     */
    @Override
    public List<EquipmentMessageModel> selectEquipmentMessageBySn(EquipmentMessageSelectInParam equipmentMessageSelectInParam) {
        return equipmentMessageMapper.selectEquipmentMessageBySn(equipmentMessageSelectInParam);
    }
}
